package(
    default_testonly = 1,
    default_visibility = ["//:__subpackages__"],
)

licenses(["notice"])

cc_library(
    name = "cli_util",
    srcs = ["cli_util.cc"],
    hdrs = ["cli_util.h"],
    data = ["@tink_base//testdata:credentials"],
    deps = [
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/strings",
        "@tink_cc",
        "@tink_cc//:binary_keyset_reader",
        "@tink_cc//:cleartext_keyset_handle",
        "@tink_cc//:json_keyset_reader",
        "@tink_cc//:json_keyset_writer",
        "@tink_cc//:kms_clients",
        "@tink_cc//config:tink_config",
        "@tink_cc//integration/awskms:aws_kms_client",
        "@tink_cc//integration/gcpkms:gcp_kms_client",
        "@tink_cc//util:status",
    ],
)

cc_binary(
    name = "aws_kms_aead_cli",
    srcs = ["aws_kms_aead_cli.cc"],
    deps = [
        ":cli_util",
        "@aws_cpp_sdk//:aws_sdk_core",
        "@tink_cc",
        "@tink_cc//integration/awskms:aws_crypto",
        "@tink_cc//integration/awskms:aws_kms_aead",
        "@tink_cc//integration/awskms:aws_kms_client",
    ],
)

cc_binary(
    name = "gcp_kms_aead_cli",
    srcs = ["gcp_kms_aead_cli.cc"],
    deps = [
        ":cli_util",
        "@tink_cc",
        "@tink_cc//integration/gcpkms:gcp_kms_aead",
        "@tink_cc//integration/gcpkms:gcp_kms_client",
    ],
)

cc_binary(
    name = "aead_cli_cc",
    srcs = ["aead_cli.cc"],
    deps = [
        ":cli_util",
        "@tink_cc",
    ],
)

sh_test(
    name = "aws_kms_aead_test",
    size = "medium",
    srcs = [
        "aws_kms_aead_test.sh",
    ],
    data = [
        ":aws_kms_aead_cli",
        "//testing/cross_language:test_lib",
        "@tink_base//testdata:credentials",
    ],
    tags = ["no_rbe"],
)

sh_test(
    name = "gcp_kms_aead_test",
    size = "medium",
    srcs = [
        "gcp_kms_aead_test.sh",
    ],
    data = [
        ":gcp_kms_aead_cli",
        "//testing/cross_language:test_lib",
        "@google_root_pem//file",
        "@tink_base//testdata:credentials",
    ],
    tags = ["manual"],
)
